package com.du.springmvc.view;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.View;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @author : DuJiabao
 * @Date : 2021/4/1 19:08
 * @Project : spring-mvc
 * @File : null.java
 * @Desc :
 */
@Component
public class HelloView implements View {
  @Override
  public String getContentType() {
    return "text/html;charset=utf-8";
  }

  @Override
  public void render(Map<String, ?> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
    response.setContentType("text/html;charset=utf-8");
    response.getWriter().write("自定义view测试");
  }
}
